﻿<Application 
    x:Class="OdcTest.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:fx="clr-namespace:Odyssey.Effects;assembly=Odyssey"
    xmlns:odc="clr-namespace:Odyssey.Controls;assembly=Odyssey"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:vm="clr-namespace:OdcTest.ViewModels"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">

    <Application.Resources>
        <vm:PickersViewModel x:Key="pickersViewModel"/>

        <Style TargetType="odc:OdcListBoxItem" x:Key="panoramaListBoxStyle">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="odc:OdcListBoxItem">
                        
                        <!--Outer border is reserved for Tilt effect:-->
                        <Border>
                            <Border x:Name="LayoutRoot" BorderBrush="{TemplateBinding BorderBrush}"  CacheMode="BitmapCache"  fx:FeatherEffect.IsElement="True" Opacity="0"
                                fx:FeatherEffect.IsLast="{Binding IsSelected, RelativeSource={RelativeSource TemplatedParent}}">
                                <Border.Triggers>
                                    <EventTrigger>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.75"  >
                                                    <DoubleAnimation.EasingFunction>
                                                        <QuadraticEase/>
                                                    </DoubleAnimation.EasingFunction>
                                                </DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </EventTrigger>
                                </Border.Triggers>

                                <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" 
                                        Content="{TemplateBinding Content}" 
                                        Foreground="{TemplateBinding Foreground}" 
                                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                        Margin="{TemplateBinding Padding}" />
                            </Border>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService 
            Launching="Application_Launching" Closing="Application_Closing" 
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>